﻿using System;
using System.Collections.Generic;
using System.Text;
using log4net;

namespace GroupChat2013.Common
{
    /// <summary>
    /// 日志工具类，用来记录处理日志
    /// </summary>
    public class LogHelper
    {
        private static ILog m_log;
        private static object locker = new object();

        /// <summary>
        /// 构造函数
        /// </summary>
        static LogHelper()
        {
            log4net.Config.XmlConfigurator.Configure();
            m_log = LogManager.GetLogger("GroupChat.logger");
        }

        /// <summary>
        /// 记录错误日志
        /// </summary>
        /// <param name="message">错误信息</param>
        public static void LogError(string message)
        {
            m_log.Error(message);
        }

        /// <summary>
        /// 记录调试日志
        /// </summary>
        /// <param name="message">错误信息</param>
        public static void LogDebug(string message)
        {
            m_log.Debug(message);
        }

        /// <summary>
        /// 记录警告错误
        /// </summary>
        /// <param name="message">错误信息</param>
        public static void LogWarn(string message)
        {
            m_log.Warn(message);
        }

        /// <summary>
        /// 记录提示错误
        /// </summary>
        /// <param name="message">错误信息</param>
        public static void LogInfo(string message)
        {
            m_log.Info(message);
        }
    }
}
